<!-- quirks -->
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"/>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta name="renderer" content="webkit"/>
	<title>对象操作</title>
	<link href="../../ting-quirks.css" rel="stylesheet"/>
	<!--[if lt IE 9]><script src="../../dist/sky-compat.js"></script><![endif]-->
	<!--[if gte IE 9]><!--><script src="../../dist/sky-modern.js"></script><!--><![endif]-->
	<script src="../../demo.js"></script>
</head>
<body>
<div class="container-fluid">
	<h2>对象操作</h2>
	<h3 id="pick">Sky.pick</h3>
	<p>返回一个只有列入挑选key属性的对象。</p>
	<pre class="code">var object = { 'a': 1, 'b': '2', 'c': 3 };
Sky.pick(object, ['a', 'c']);
// => { 'a': 1, 'c': 3 }</pre>
	<h3 id="omit">Sky.omit</h3>
	<p>返回一个没有列入排除key属性的对象。</p>
	<pre class="code">var object = { 'a': 1, 'b': '2', 'c': 3 };
Sky.omit(object, ['a', 'c']);
// => { 'b': '2' }</pre>
	<p>属性拷贝不会覆盖</p>
	<h3 id="extend">Sky.extend</h3>
	<p>扩展对象，一般推荐使用Object.assign。</p>
<pre class="code">var result=Sky.extend({},{name:"Tom",age:21},{name:"Jerry",sex:"Boy"});
//{name: "Jerry", age: 21, sex: "Boy"}</pre>
	<p>第一个参数boolean代表是否进行深度拷贝</p>
<pre class="code">var result=Sky.extend( true, {}, { name: "John", location: {city: "Boston",county:"USA"} }, { last: "Resig", location: {state: "MA",county:"China"} } );
//{"name":"John","location":{"city":"Boston","county":"China","state":"MA"},"last":"Resig"}</pre>
	<h3 id="forIn">Sky.forIn forOwn</h3>
	<p>遍历对象的元素。</p>
<pre class="code">Sky.forIn( {"key":"value"}, function( value, key){
	alert(this[key]);
});</pre>
	<h3 id="isXxx">Sky.isXxx</h3>
	<p>判断类型</p>
	<table class="table table-bordered table-condensed table-striped">
		<thead>
		<tr class="primary">
			<th>方法</th><th>描述</th>
		</tr>
		</thead>
		<tbody class="table-hover">
		<tr><td>isArray</td><td>是否是数组</td></tr>
		<tr><td>isDate</td><td>是否是日期</td></tr>
		<tr><td>isString</td><td>是否是字符串</td></tr>
		<tr><td>isRegExp</td><td>是否是正则表达式</td></tr>
		<tr><td>isFunction</td><td>是否是函数</td></tr>
		<tr><td>isNumber</td><td>是否是数字</td></tr>
		<tr><td>isObject</td><td>是否是对象（typeof）</td></tr>
		<tr><td>isPlainObject</td><td>是否是纯对象</td></tr>
		<tr><td>isNumeric</td><td>是否是数字 "10" "10.3"</td></tr>
		<tr><td>isDefined</td><td>是否未定义</td></tr>
		<tr><td>isArrayLike</td><td>是否是类数组（包括string）</td></tr>
		<tr><td>isArrayLikeObject</td><td>是否是类数组对象（不包括string）</td></tr>
		<tr><td>isElement</td><td>是否是元素</td></tr>
		<tr><td>isEmpty</td><td>是否是空 包括Set Array ArrayLike</td></tr>
		</tbody>
	</table>
	<h3>Sky.noop</h3>
	<p>函数是一个空函数,它什么也不做。</p>
</div>
</body>
</html>